package model;

import static org.junit.Assert.*
import model.agent.Firm
import model.agent.HouseHold

import org.junit.After
import org.junit.AfterClass
import org.junit.Before
import org.junit.BeforeClass
import org.junit.Test

class BuySellTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public final void test() {
		Firm f = new Firm(who:1)
		f.mMoney = 1
		f.mIv = 1
		f.mPrice = 1
		f.mDm = 0
		f.mWage = 1
		f.mPosi = 0
		
		
		HouseHold h = new HouseHold(who:1)
		
		h.money = 1
		h.workingFirm=f
		
		f.workers.add(h)
		
		def fs = []
		fs.add(f)
		h.shoppingFirms = fs
		
		
		f.initMonth()
		h.initMonth()
		
		println "月初"
		println f.prop
		println h.prop

		h.shopping()
		
		println "购物后："
		println f.prop
		println h.prop
		
		f.endMonth()
		h.endMonth()
		
		println "月末："
		println f.prop
		println h.prop
		
		
		
		
	}

}
